import React, { useEffect, useState } from 'react'
import { useRouter } from 'next/dist/client/router';


const Detail = () => {
    let router = useRouter()
    let [item,setItem] = useState({} as any)
    useEffect(()=>{
     if(router.query.obj){
        setItem(JSON.parse(router.query.obj as any))
     }
    },[router.query.id])
    console.log(item,"item")
  return (
    <div style={{
        background:"url(https://img2.baidu.com/it/u=377131104,1121260968&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500) no-repeat",
        width:'100vw',
        height:"100vh",
        backgroundSize:"100% 100%",
        color:"white"
        }}> Detail 页
        <div style={{
                paddingLeft:"36px"
            }}>
            <h2 >名称： {item.name || '张三'} </h2>
            <div>
                区域：{item.quyu}
            </div>
            <div>
                价格：{item.jiage}元
            </div>
            <div>
                小区：{item.xq}
            </div>
            <div>
                我家有：{item.yt}
            </div>
        </div>

    </div>
  )
}

export default Detail